/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author melchiorin
 */
class Rule {
    private Map<String, String> premises = new HashMap<String, String>()
    private Map<String, String> conclusions = new HashMap<String, String>()
    private def id

    public String toString(){
        def string = ""
            
        string += getPremisesString()
        string += getConclusionsString()
            
        return string
    }

    public String getConclusionsString(){
        def result = "";
        conclusions.each(){
            key, value -> result += key + "=" + value + ","
        }
        return result;
    }

    public String getPremisesString(){
        def result = "";
        premises.each(){
            key, value -> result += key + "=" + value + ","
        }
        return result;
    }

    public boolean equals(obj){
        boolean result = false
        if(obj instanceof Rule)            
            if(obj.id == this.id)
                result = true

        return result
    }
}

